import json
import sqlite3
from os import sep

default_info = json.load(open('DaBai_v1' + sep + 'baseinfo.json', 'rb'))
conn = sqlite3.connect('db.sqlite3')
shell = conn.cursor()
if __name__ == '__main__':
    import sys

    print(f'Python {sys.version} on {sys.platform}')
    print('Type "help", "copyright", "credits" or "license" for more information.')
    while True:
        try:
            order = input('>>> ')
            if 'while' in order or 'for' in order or 'def' in order \
                    or 'class' in order or 'try' in order or 'match' in order:
                order += '\n'
                temp = input('... ')
                temp.replace('\t', '    ')
                while temp:
                    order += temp
                    temp = input('... ')
            try:
                exec(f"if (temp:={order}) is not None:print(temp)")
            except Exception as _:
                exec(order)
        except Exception as error:
            print(type(error), error, sep='\n    ')

conn.close()
